package com.ideal.dto.config.req;

import com.ideal.config.Constant;
import com.ideal.util.DateUtils;
import lombok.Data;

import java.util.Date;

/**
 * @Author songfz
 * @Description  版本分页请求参数
 * @Date 2022/7/22
 */
public class VersionPageReqDto {


    private Long configId;

    private Integer pageSize;

    private Integer pageNum;

    private String version;

    private String[] createdTime;
    /**
     * 开始时间
     */
    private Date startTime;

    /**
     * 结束时间
     */
    private Date endTime;

    public Long getConfigId() {
        return configId;
    }

    public void setConfigId(Long configId) {
        this.configId = configId;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public String[] getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String[] createdTime) {
        this.createdTime = createdTime;
        if (createdTime.length == 2) {
            try {
                this.startTime = DateUtils.toDate(createdTime[0], Constant.DATE_PATTERN);
                this.endTime = DateUtils.toDate(createdTime[1], Constant.DATE_PATTERN);
            } catch (Exception e) {
            }
        }
    }

    public Date getStartTime() {
        return startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }
}
